package kr.hkit.powerjava.chapter22.work2.vc;

public class Department {
	private int deptNo;
	private String deptName;
	private int floor;
	
	public Department(int deptNo, String deptName) {
		this.deptNo = deptNo;
		this.deptName = deptName;
	}

	public Department(int deptNo, String deptName, int floor) {
		this.deptNo = deptNo;
		this.deptName = deptName;
		this.floor = floor;
	}

	public int getDeptNo() {
		return deptNo;
	}

	public void setDeptNo(int deptNo) {
		this.deptNo = deptNo;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public int getFloor() {
		return floor;
	}

	public void setFloor(int floor) {
		this.floor = floor;
	}

	@Override
	public String toString() {
		return String.format("%-5d %5s %5s",
				deptNo, deptName, floor);
	}
	
	@Override
	public boolean equals(Object o) {
		if(getDeptName().equals(((Department)o).getDeptName()) &&
				getDeptNo() == ((Department)o).getDeptNo()){
			return true;
		} else {
			return false;
		}
	}
	
}
